// store/address.js

export default {
  state: {
    addresses: [
      { address: '有一间公寓八栋', name: '隔壁老王', phone: '15106655709', sex: '先生', isDefault: true },
      { address: '有两间公寓二栋', name: '老六', phone: '15863866538', sex: '女士', isDefault: true },
    ],
  },
  mutations: {
    ADD_ADDRESS(state, address) {
      state.addresses.push(address);
    },
  },
  actions: {
    addAddress({ commit }, address) {
      commit('ADD_ADDRESS', address);
    },
  },
  getters: {
    getAddressList: (state) => state.addresses,
  },
};
